from selenium import webdriver
from selenium.webdriver.common.by import By
from options import options
from time import sleep

url = r'http://172.16.36.121/upload/'
deiver = webdriver.Chrome(options=options)
deiver.get(url)
deiver.maximize_window()
#登录
deiver.find_element(By.ID,'ls_username').clear()
deiver.find_element(By.ID,'ls_username').send_keys('admin')
deiver.find_element(By.ID,'ls_password').clear()
deiver.find_element(By.ID,'ls_password').send_keys('sa')
sleep(3)
deiver.find_element(By.XPATH,'//*[@id="lsform"]/div/div/table/tbody/tr[2]/td[3]/button/em').click()
sleep(3)
#   回复帖子
deiver.find_element(By.XPATH,'//*[@id="category_1"]/table/tbody/tr[1]/td[2]/h2/a').click()  #   点击默认板块
sleep(2)
deiver.find_element(By.XPATH,'//*[@id="normalthread_3"]/tr/th/a[2]').click()    #   点击帖子
sleep(2)
deiver.find_element(By.ID,'fastpostmessage').send_keys('biubibuibiu')   #   回复帖子内容
deiver.find_element(By.ID,'fastpostsubmit').click()     #   点击发表回复
sleep(2)
#   退出
deiver.find_element(By.XPATH,'//*[@id="um"]/p[1]/a[7]').click()
sleep(3)
deiver.quit()